@extends('layout.layout')
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
  <script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>  
</head>
<body>
<h1>&nbsp;&nbsp;&nbsp;&nbsp;图片管理-图片添加</h1>

<link rel="stylesheet" href="/style/index.css">
<form action="{{url('admin/wheelCreate')}}" method="post" enctype="multipart/form-data">
  @csrf
  <table>
    <h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;轮播图添加</h3>
    <div class="upload imgLog2">
      <span><i class="glyphicon glyphicon-open"></i>上传头像</span>
    </div>
    <div>
    <label>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否展示
      <input type="radio" name="is_show" value="1" checked>是
      <input type="radio" name="is_show" value="2">否      
    </label>
    </div>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="图片上传" class="btn btn-info">
  </table>
</form>
<script src="/style/index.js"></script>
  <script>
    $(function(){
      var img2 = new ImgUpload('.imgLog2',200,200,200);
            $(document).on('change',".imgLog2 input",function(e){
          //模拟后台返回url
        $("[type='file']").attr("name",'wheel_img');
          var url = window.URL.createObjectURL(e.target.files[0]);
          $(this).parent().css('background','url('+url+')0% 0% / cover')
          img2.setSpan(this)
      })  
    })

  </script>
</body>
</html>